#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()
{
	ll n, m, k;

	cin >> n >> m >> k;

	ll cnt = 0;

	for (ll i = 0; i < n; i++)
	{
		for (ll j = 0; j < m; j++)
		{
			char tmp;
			cin >> tmp;
			cnt += tmp - '0';
		}
	}

	for (ll i = 0; i <= k; i++)
	{
		if (i * 2 + (k - i) * 3 == cnt)
		{
			printf("%d %d", k - i, i);
			break;
		}
	}


	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()
{
	ll n, q;

	cin >> n >> q;

	string s;
	cin >> s;

	vector<ll> change(n, 0);

	while (q--)
	{
		ll l, r, k;
		cin >> l >> r >> k;

		k = k % 26;

		for (ll i = l - 1; i < r; i++)
		{
			change[i] += k;
		}
	}

	for (ll i = 0; i < n; i++)
	{
		change[i] %= 26;
		s[i] = ((s[i] - 'a') + change[i]) % 26 + 'a';
	}

	cout << s;

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()
{
	ll n;
	cin >> n;

	vector<ll> nums(n);

	for (ll i = 0; i < n; i++)
		cin >> nums[i];
	ll cnt = 0;

	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			ll tmp = nums[i] & nums[j];

			while (tmp)
			{
				if (tmp % 2 == 1)
					cnt++;
				tmp /= 2;
			}
		}
	}

	cout << cnt;

	return 0;
}